import { view, del, history, historyDetail } from '@/services/office';

const Model = {
  namespace: 'office',
  state: {},
  effects: {
    *fetch({ payload, callback }, { call }) {
      const response = yield call(view, payload);
      if (callback) {
        callback(response);
      }
    },
    *view({ payload, callback }, { call }) {
      const response = yield call(view, payload);
      if (callback) {
        callback(response);
      }
    },
    *history({ payload, callback }, { call }) {
      const response = yield call(history, payload);
      if (callback) {
        callback(response);
      }
    },
    *historyDetail({ payload, callback }, { call }) {
      const response = yield call(historyDetail, payload);
      if (callback) {
        callback(response);
      }
    },
    *del({ payload, callback }, { call }) {
      const response = yield call(del, payload);
      if (callback) {
        callback(response);
      }
    },
  },
  reducers: {},
};
export default Model;
